﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GoF23Learning._17.Mediator_Pattern.Refactor
{
    public abstract class Element
    {
        Meditor mediator;

        public Element(Meditor mediator)
        {
            this.mediator = mediator;
            this.mediator.AddElement(this);
        }

        public  virtual void OnChange()
        {
            mediator.Notify();
        }
    }
}
